package com.li.service;

import com.li.mapper.Course1Mapper;
import com.li.pojo.Course1;
import com.li.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Course1Service {

    @Autowired
    Course1Mapper course1Mapper;

    public Course1 queryCourse1(Course1 course1){
        return course1Mapper.queryCourse1(course1);
    }

    public boolean addCourse1(Course1 course1){
        if(course1Mapper.queryCourse1ByCnumber(course1)==null){
            course1Mapper.insertCourse1(course1);
            return  true;
        }
        return false;
    }

    public boolean deleteCourse1(Course1 course1){
        if(course1Mapper.queryCourse1ByCnumber(course1)!=null){
            course1Mapper.deleteCourse1(course1);
            return true;
        }
        return false;
    }
    public boolean updateCourse1(Course1 course1){
        course1Mapper.updateCourse1(course1);
        return  true;
    }
    public List<Course1> allCourse1(){
        return course1Mapper.listCourse1();
    }
}
